<template>
  <div class="divs">
    <div class="right">
      <el-form
        ref="form"
        :model="form"
        label-width="80px"
        style="display: flex"
      >
        <el-form-item label="药品分类">
          <el-select
            v-model="form.region"
            placeholder="全部分类"
            style="width: 100px"
          >
            <el-option label="中药"></el-option>
            <el-option label="西药"></el-option>
            <el-option label="中西结合"></el-option>
          </el-select>
        </el-form-item>

        <el-input v-model="form.name" style="margin-left: 20px"></el-input>
      </el-form>
    </div>
    <div class="rights">
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection"  width="60"> </el-table-column>
        <el-table-column label="名称" prop="name"  width="60"> </el-table-column>

        <el-table-column prop="yf" label=""  width="60"> </el-table-column>
        <el-table-column prop="dj" label=""  width="60">
        </el-table-column>
        <el-table-column prop="oneeat" label=""  width="60">
        </el-table-column>
      </el-table>
    </div>
    <div class="add">
      <h4 @click="adddruk">添加药品</h4>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
      },

      tableData: [
        {
          xh: 1,
          zh: 2,
          name: "阿莫西林",
          oneeat: "1g*1",
          yf: "口服",
          pd: "每日三次",
          ts: "七天",
          zl: "700mml",
          dj: 199,
        },
      ],
      multipleSelection: [], //就是我们选择的值的数组(checkbox选中的值)
    };
  },
  methods: {
    handleSelectionChange(val) {
      (this.multipleSelection = val), console.log("val", val);
    },

    adddurk(val) {
      (this.multipleSelection = val), this.$emit("searchfunparent", this.val);
    },
  },
};
</script>

<style lang="less" scoped>
.divs {
  margin-left: 30px;
  height: 550px;
  // border: 2px solid black;
  margin-top: 10px;
}
.right {
  margin-top: 20px;
}
.rights {
  height: 430px;
}
.add {
  background-color: blue;
  color: white;
  text-align: center;
  line-height: 40px;
  width: 100px;
  height: 40px;
  border-radius: 10px;
  margin-top: 20px;
  cursor: pointer;
}
</style>